package com.atguigu.userprofile.dao;

import com.atguigu.userprofile.bean.TagInfo;
import com.atguigu.userprofile.util.MySQLUtil;

import java.util.List;

public class TagInfoDao {
    public static TagInfo getTagInfo(String taskId){
        String sql = "select * from tag_info where tag_task_id = '" + taskId + "'";
        TagInfo tagInfo = MySQLUtil.queryOne(sql, TagInfo.class, true);
        return tagInfo;
    }

    public static List<TagInfo> getTagInfoWithOn(){
        String sql = "SELECT * FROM tag_info tgi JOIN (SELECT id FROM task_info WHERE task_status=1) tai ON tgi.tag_task_id=tai.id";
        return MySQLUtil.queryList(sql, TagInfo.class, true);
    }


}

